package com.zzyl.nursing.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.time.LocalDateTime;

/**
 * 预约信息实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "Reservation", description = "预约信息表")
public class Reservation1 {

    @ApiModelProperty(value = "主键ID", example = "1", required = true)
    private Long id;

    @ApiModelProperty(value = "预约人姓名", required = true, notes = "例如：张三")
    private String name;

    @ApiModelProperty(value = "预约人手机号", required = true, example = "13800138000")
    private String mobile;

    @ApiModelProperty(value = "预约时间", required = true, example = "2025-09-25 10:00:00")
    private LocalDateTime time;

    @ApiModelProperty(value = "探访人（家人姓名）", required = true, notes = "被探访的家属姓名")
    private String visitor;

    @ApiModelProperty(value = "预约类型：0-参观预约，1-探访预约", allowableValues = "0,1", example = "1")
    private Integer type;

    @ApiModelProperty(value = "预约状态：0-待报道，1-已完成，2-取消，3-过期", allowableValues = "0,1,2,3", example = "0")
    private Integer status;

    @ApiModelProperty(value = "创建时间", example = "2025-09-21 10:00:00")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间", example = "2025-09-21 14:30:00")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "创建人ID", example = "1001")
    private Long createBy;

    @ApiModelProperty(value = "更新人ID", example = "1001")
    private Long updateBy;

    @ApiModelProperty(value = "备注", example = "需要轮椅协助", allowableValues = "最多255字符")
    private String remark;

    // ================== 枚举建议（可选，增强可读性）==================

    /**
     * 预约类型枚举
     */
    @ApiModel("预约类型")
    public enum Type {
        VISIT(0, "参观预约"),
        ACCOMPANY(1, "探访预约");

        private final int value;
        private final String desc;

        Type(int value, String desc) {
            this.value = value;
            this.desc = desc;
        }

        public int getValue() {
            return value;
        }

        public String getDesc() {
            return desc;
        }
    }

    /**
     * 预约状态枚举
     */
    @ApiModel("预约状态")
    public enum Status {
        PENDING(0, "待报道"),
        COMPLETED(1, "已完成"),
        CANCELLED(2, "取消"),
        EXPIRED(3, "过期");

        private final int value;
        private final String desc;

        Status(int value, String desc) {
            this.value = value;
            this.desc = desc;
        }

        public int getValue() {
            return value;
        }

        public String getDesc() {
            return desc;
        }
    }
}
